<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div>
        {{ request.session.user.username}} 的笔记
        <a href="/note/add">添加新笔记</a>
        <a href="/">返回首页</a>
    </div>
    <div>
        <table>
            <tr>
                <th>ID</th>
                <th>标题</th>
                <th>创建时间</th>
                <th>修改时间</th>
            </tr>
            {% for note in page %}
            <tr>
                <td>{{ note.id }}</td>
                <td>{{ note.title }}</td>
                <td>{{ note.create_time }}</td>
                <td>{{ note.mod_time }}</td>
                <td><a href="/note/mod/{{ note.id }}">修改</a>
                </td>
                <td><a href="/note/del/{{ note.id }}">删除</a>
                </td>
            </tr>
            {% endfor %}
        </table>

        {% if page.has_previous %}
        <a href="/note/?page={{ page.previous_page_number }}"
        >上一页</a>
        {% else %}
        上一页
        {% endif %}

        {% for p in paginator.page_range %}
        {% if p == page.number %}
        {{ p }}
        {% else %}
        <a href="/note/?page={{ p }}">{{ p }}</a>
        {% endif %}
        {% endfor %}

        {% if page.has_next %}
        <a href="/note?page={{ page.next_page_number }}"
        >下一页</a>
        {% else %}
        下一页
        {% endif %}
    </div>




</body>
</html>